<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        div{
            width: 100px;
            height: 100px;
            border: 1px solid red;
        }
        /*悬停转态*/
        div:hover{
            position: relative;/*相对定位*/
            top: 10px;
            left: 10px;
            /*margin: 18px 0 0 10px;*/
        }
    </style>
</head>
<body>
<div id="d1">div1</div>
<div id="d2">div2</div>
</body>
</html>